package icasue.tools.sqlhelper.core.providers;

import icasue.reflect.annotations.NotNull;
import icasue.tools.sqlhelper.core.Consult;

/**
 * @Author: Qiao Hang
 * @CreateDate: 2021/11/18 下午4:34
 * @UpdateDate:
 * @Description:
 */
public interface DeleteSqlProvider<JavaType extends Object> {
    /**
     * 通过主键匹配删除数据库记录.
     * @param inst
     * @throws Throwable
     */
    String deleteByPrimary(@NotNull JavaType inst) throws Throwable;

    /**
     * 动态删除, 不考虑null映射.
     * @param inst
     * @throws Throwable
     */
    String deleteSmart(@NotNull JavaType inst) throws Throwable;

    /**
     * 通过咨询删除数据库记录.
     * @throws Throwable
     */
    String deleteByConsult(@NotNull Consult<JavaType> consult) throws Throwable;
}
